﻿<h1>New voucher-test</h1>

<%= start_form_tag :action => 'create' %>
  <%= render :partial => 'form' %>
  <%= submit_tag "Create" %>
<%= end_form_tag %>

<div style="border:solid #336699 " >


<h3>Add line Item</h3>
<table>
  <tr>
    <th>摘要</th>
    <th>科目</th>
    <th>借</th>
    <th>货</th>
  </tr>

 <% for cc in @cart.items %>
   <tr>
     <td><%=cc.des%></td>
     <td><%=cc.subject_id%></td>
     <td><%=cc.debit%></td>
     <td><%=cc.credit%></td>
   </tr>
<% end %>
</table>

<%= start_form_tag :action => 'create_line_item' %>
<p><label for="line_item_des">Description</label><br/>
<%= text_field 'line_item', 'des'  %></p>

<p><label for="line_item_subject_id">Subject Id</label><br/>

<%= hidden_field 'line_item', 'subject_id'  %>
<input id="line_item_subject_no" type="text" >
<input id="line_item_subject_name" type="text" >
<input type="button" value="Select" onclick="window.open('/admin/','','height=400,width=600,top=100,left=100,toolbar=no,menubar=no,resizable=yes')"></p>

<p><label for="line_item_debit">Debit</label><br/>
<%= text_field 'line_item', 'debit'  %></p>

<p><label for="line_item_credit">Credit</label><br/>
<%= text_field 'line_item', 'credit'  %></p>
<%= submit_tag "CreateItem" %>
<p />
<%= end_form_tag %>

<%= start_form_tag :action => 'clear_line_item' %>
<%= submit_tag "Clear" %>
<%= end_form_tag %>

</div>

<%= link_to 'Back', :action => 'list' %>
